#!usr/bin/env python  
#@time: 2018/01/19 
from multiprocessing import Process
import os

#child Thread execute code
def run_proc(name):
    count = 1
    while(count <= 10):
        count +=1
        print('Run child process %s (%s)...' %(name, os.getpid()))

if __name__ == '__main__':
    print('父类 进程 %s.' % os.getpid())
    p = Process(target=run_proc, args=('test',))
    print("子 进程 开始 启动")
    p.start()
    # join方法可以等待 子进程结束后在继续往下执行，通常用于进程间的同步
    # p.join()
    print('子进程结束')